import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '笔记id',
    align:"center",
    dataIndex: 'noteId'
   },
   {
    title: '评论id',
    align:"center",
    dataIndex: 'comId'
   },
   {
    title: '评论内容',
    align:"center",
    dataIndex: 'content'
   },
   {
    title: '点赞数',
    align:"center",
    dataIndex: 'likeCount'
   },
   {
    title: '子评论数量',
    align:"center",
    dataIndex: 'subCommentCount'
   },
   {
    title: '评论人uid',
    align:"center",
    dataIndex: 'userid'
   },
   {
    title: '评论人昵称',
    align:"center",
    dataIndex: 'nickname'
   },
   {
    title: '评论人Rid',
    align:"center",
    dataIndex: 'redId'
   },
   {
    title: '定位',
    align:"center",
    dataIndex: 'ipLocation'
   },
   {
    title: '评论发布时间',
    align:"center",
    dataIndex: 'time'
   },
   {
    title: '图片评论url，逗号分隔',
    align:"center",
    dataIndex: 'picturesUrl'
   },
   {
    title: '是否已发送通知',
    align:"center",
    dataIndex: 'isNotice'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "笔记id",
      field: 'noteId',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "评论id",
      field: 'comId',
      component: 'InputNumber',
      //colProps: {span: 6},
 	},
	{
      label: "评论内容",
      field: 'content',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "点赞数",
      field: 'likeCount',
      component: 'InputNumber',
      //colProps: {span: 6},
 	},
	{
      label: "评论人uid",
      field: 'userid',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "评论人昵称",
      field: 'nickname',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "评论人Rid",
      field: 'redId',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "定位",
      field: 'ipLocation',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "评论发布时间",
      field: 'time',
      component: 'DatePicker',
      componentProps: {
         showTime:true,
         valueFormat: 'YYYY-MM-DD HH:mm:ss'
       },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '笔记id',
    field: 'noteId',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '评论id',
    field: 'comId',
    component: 'InputNumber',
    dynamicDisabled:true
  },
  {
    label: '评论内容',
    field: 'content',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '点赞数',
    field: 'likeCount',
    component: 'InputNumber',
    dynamicDisabled:true
  },
  {
    label: '子评论数量',
    field: 'subCommentCount',
    component: 'InputNumber',
    dynamicDisabled:true
  },
  {
    label: '评论人uid',
    field: 'userid',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '评论人昵称',
    field: 'nickname',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '评论人Rid',
    field: 'redId',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '定位',
    field: 'ipLocation',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '评论发布时间',
    field: 'time',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
    dynamicDisabled:true
  },
  {
    label: '图片评论url，逗号分隔',
    field: 'picturesUrl',
    component: 'Input',
    dynamicDisabled:true
  },
  {
    label: '是否已发送通知',
    field: 'isNotice',
    component: 'InputNumber',
    dynamicDisabled:true
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  noteId: {title: '笔记id',order: 0,view: 'text', type: 'string',},
  comId: {title: '评论id',order: 1,view: 'number', type: 'number',},
  content: {title: '评论内容',order: 2,view: 'text', type: 'string',},
  likeCount: {title: '点赞数',order: 3,view: 'number', type: 'number',},
  subCommentCount: {title: '子评论数量',order: 4,view: 'number', type: 'number',},
  userid: {title: '评论人uid',order: 5,view: 'text', type: 'string',},
  nickname: {title: '评论人昵称',order: 6,view: 'text', type: 'string',},
  redId: {title: '评论人Rid',order: 7,view: 'text', type: 'string',},
  ipLocation: {title: '定位',order: 8,view: 'text', type: 'string',},
  time: {title: '评论发布时间',order: 9,view: 'datetime', type: 'string',},
  picturesUrl: {title: '图片评论url，逗号分隔',order: 10,view: 'text', type: 'string',},
  isNotice: {title: '是否已发送通知',order: 11,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}